function IntToBin(n:int64):string;
var t:string; i:longint;
begin
t:='';
while n>0 do begin
      t:=t+inttostr(n mod 2);
      n:=n div 2;
end;
result:='';
for i:=length(t) downto 1 do
    result:=result+t[i];
end;